Repository navigation
audit: fix build breaks, buffer overflows, RA parsing and SemVer compare - #2
Merged
Merged
Conversation
Audit of the whole repo (Domain, Engine, Infrastructure, App) with full test runs - nothing left unverified. Fixes: - RomLinks referenced App's SaveDescriptions.EmulatorName, breaking the Domain build; EmulatorCatalog.Name(EmulatorKind) is now the single source of truth and SaveDescriptions.EmulatorName delegates to it. - ApplyEdit/ApplyInstructions/SetOriginalTrainerName passed untrimmed names to PKHeX setters, overflowing the per-format string buffers; nicknames and OT names are now trimmed to MaxStringLengthNickname/MaxStringLengthTrainer (10 Gen 1-5, 12 Gen 6+, 5 for Japanese Gen 1/2). LegalizerService's nickname restore uses the same trim. - TrophyScanService measured playtime from the shelf string even when the save has its own counter; the save's trainer stats now win. - AppUpdate prerelease comparison used ordinal string compare (beta.10 < beta.2); now SemVer: numeric identifiers compare numerically, numeric ranks below alphanumeric, more dot-identifiers win a shared-prefix tie. - HttpRetroAchievementsClient treated the mere presence of DateEarned as an unlock; RA's current API omits the field when locked, but older responses returned an empty string. Parsing moved to RetroAchievementsJson in Domain (unit tested): a unlock requires a non-empty string. Empty-object achievement sets (RA issue #484) and missing fields are handled. - App build breaks: EmulatorsPage missed using PKForge.App.Services (IPadHandler, PadButton); AndroidEmulatorLauncher missed using PKForge.App.ViewModels (SaveDescriptions) and caught System.SecurityException instead of Java.Lang.SecurityException; SaveIdentitySheet had a CS0136 shadowed local; EmulatorsPage used obsolete ScaleTo (CS0618 as error); TrophiesPage had an unused field (CS0169 as error); HttpRetroAchievementsClient had a duplicate using (CS0105). - Removed dead SaveEngine.UnboundNotEditable. - Fixed incoherent TrophyTests expectation (DexCaught measured 60, expected 59). Tests: - NicknameLimitTests: per-generation nickname/OT truncation round-trips through real blank sessions, incl. Japanese Gen 1 (6-byte buffers, kana-only table). - RetroAchievementsJsonTests: earned/locked/empty-string/null DateEarned, softcore-only, missing fields, empty set, id ordering, error shapes. - AppUpdateRulesTests: prerelease ordering cases. - RomLinkTests: stable emulator display names and RomLinkRules.Describe. Verified locally: Domain 952/952, Engine 992/992, Debug and Release APK builds (maui-android + Android SDK 36 + Temurin 17) all succeed. Co-authored-by: Varonal <[email protected]>
Varonal
marked this pull request as ready for review
October 29, 2026 13:55
Varonal
added a commit
that referenced
this pull request
Oct 29, 2026
The PR #1 merge had taken only part of vibe/emulators-rom-launcher-ra: the 12 commits after 0f99547 (the in-game companion, the French pass, the launch fixes, the library page itself) never reached main, which is why main had neither RomLibraryPage nor the companion. This merge brings them in alongside the audit PR #2, and resolves TrophiesPage in favour of the column fix — without Grid.SetColumn the glyph, title and value all stack in column 0 (the reported one-column layout). Co-authored-by: Varonal <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Full-repo audit of PKForge with verified fixes — nothing left unverified: every change is covered by tests and the whole solution (including the Android APK) builds locally.
Fixes
RomLinksreferenced App'sSaveDescriptions.EmulatorName.EmulatorCatalog.Name(EmulatorKind)is now the single source of truth;SaveDescriptions.EmulatorNamedelegates to it.ApplyEdit/ApplyInstructions/SetOriginalTrainerNamepassed untrimmed names to PKHeX setters, overflowing per-format buffers. Nicknames and OT names are now trimmed toMaxStringLengthNickname/MaxStringLengthTrainer(10 Gen 1-5, 12 Gen 6+, 5 for Japanese Gen 1/2).LegalizerService's nickname restore uses the same trim.TrophyScanServicemeasured playtime from the shelf string even when the save has its own counter; the save's trainer stats now win.beta.10 < beta.2); now proper SemVer (numeric identifiers compare numerically, numeric ranks below alphanumeric, more dot-identifiers win a shared-prefix tie).DateEarnedwas treated as an unlock. Verified against RAWeb source: the current API omits the field when locked, but older responses returned"". Parsing moved toRetroAchievementsJsonin Domain (unit tested): an unlock requires a non-empty string; empty-object achievement sets (RA issue #484) and missing fields handled.EmulatorsPagemissedusing PKForge.App.Services(IPadHandler/PadButton);AndroidEmulatorLaunchermissedusing PKForge.App.ViewModels(SaveDescriptions) and caughtSystem.SecurityExceptioninstead ofJava.Lang.SecurityException;SaveIdentitySheethad a CS0136 shadowed local;EmulatorsPageused obsoleteScaleTo(CS0618 as error);TrophiesPagehad an unused field (CS0169);HttpRetroAchievementsClienthad a duplicate using (CS0105).SaveEngine.UnboundNotEditable(private, unused).TrophyTestsexpectation (DexCaught measured 60, expected 59).Tests added
NicknameLimitTests: per-generation nickname/OT truncation round-trips through real blank sessions, incl. Japanese Gen 1 (6-byte buffers, kana-only table).RetroAchievementsJsonTests: earned/locked/empty-string/nullDateEarned, softcore-only, missing fields, empty set, id ordering, error shapes.AppUpdateRulesTests: prerelease ordering cases.RomLinkTests: stable emulator display names andRomLinkRules.Describe.Verification
dotnet test tests/PKForge.Domain.Tests -c Release— 952/952 passdotnet test tests/PKForge.Engine.Tests -c Release— 992/992 passdotnet build src/PKForge.App/PKForge.App.csproj -c Debug -f net10.0-android— succeeds (maui-android workload + Android SDK 36 + Temurin 17 installed locally)dotnet build src/PKForge.App/PKForge.App.csproj -c Release -f net10.0-android— succeeds, producesorg.pkforge.app-Signed.apkKnown remaining items (out of scope, not regressions)
GetAwaiter().GetResult()calls in UI code (potential UI-thread deadlock on some paths).SecureRetroCredentialStore(MAUI SecureStorage has no sync API).